Declare visibility on class properties of SpecialRevisionDelete
authorSiebrand Mazeland <siebrand@kitano.nl>
Sun, 23 Mar 2014 00:25:12 +0000 (01:25 +0100)
committerChad <chadh@wikimedia.org>
Wed, 26 Mar 2014 17:16:06 +0000 (17:16 +0000)
All class properties are used solely in the class itself.
SpecialRevisionDelete is not being subclassed, so made all properties
private. Also:
* Added missing class properties.
* Renamed $list to $revDelList to be more specific.
* Updated some documentation.

Change-Id: I9f989a020d46173cb313d4d3dddc33f6b92b1942

includes/specials/SpecialRevisiondelete.php

index 780da7c..99e6994 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialRevisionDelete extends UnlistedSpecialPage {
-       /** True if the submit button was clicked, and the form was posted */
-       var $submitClicked;
+       /** @var bool Was the DB modified in this request */
+       protected $wasSaved = false;
 
-       /** Target ID list */
-       var $ids;
+       /** @var bool True if the submit button was clicked, and the form was posted */
+       private $submitClicked;
 
-       /** Archive name, for reviewing deleted files */
-       var $archiveName;
+       /** @var array Target ID list */
+       private $ids;
 
-       /** Edit token for securing image views against XSS */
-       var $token;
+       /** @var string Archive name, for reviewing deleted files */
+       private $archiveName;
 
-       /** Title object for target parameter */
-       var $targetObj;
+       /** @var string Edit token for securing image views against XSS */
+       private $token;
 
-       /** Deletion type, may be revision, archive, oldimage, filearchive, logging. */
-       var $typeName;
+       /** @var Title object for target parameter */
+       private $targetObj;
 
-       /** Array of checkbox specs (message, name, deletion bits) */
-       var $checks;
+       /** @var string Deletion type, may be revision, archive, oldimage, filearchive, logging. */
+       private $typeName;
 
-       /** UI Labels about the current type */
-       var $typeLabels;
+       /** @var array of checkbox specs (message, name, deletion bits) */
+       private $checks;
 
-       /** The RevDel_List object, storing the list of items to be deleted/undeleted */
-       var $list;
+       /** @var array UI Labels about the current type */
+       private $typeLabels;
 
-       /** Was the DB modified in this request */
-       protected $wasSaved = false;
+       /** @var RevDel_List object, storing the list of items to be deleted/undeleted */
+       private $revDelList;
+
+       /** @var bool Whether user is allowed to perform the action */
+       private $mIsAllowed;
+
+       /** @var string */
+       private $otherReason;
 
        /**
         * UI labels for each type.
         */
-       static $UILabels = array(
+       private static $UILabels = array(
                'revision' => array(
                        'check-label' => 'revdelete-hide-text',
                        'success' => 'revdelete-success',
@@ -325,13 +331,13 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * Get the list object for this request
         */
        protected function getList() {
-               if ( is_null( $this->list ) ) {
-                       $this->list = RevisionDeleter::createList(
+               if ( is_null( $this->revDelList ) ) {
+                       $this->revDelList = RevisionDeleter::createList(
                                $this->typeName, $this->getContext(), $this->targetObj, $this->ids
                        );
                }
 
-               return $this->list;
+               return $this->revDelList;
        }
 
        /**
@@ -552,7 +558,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
                $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeLabels['success'] );
                $this->wasSaved = true;
-               $this->list->reloadFromMaster();
+               $this->revDelList->reloadFromMaster();
                $this->showForm();
        }
 
@@ -592,7 +598,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         * @param $bitfield
         * @param $reason
         * @param $title
-        * @return
+        * @return Status
         */
        protected function save( $bitfield, $reason, $title ) {
                return $this->getList()->setVisibility(